import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router'
import './style.css'
import '@/assets/style/reset.css'
import '@/assets/style/common.scss'
import '@/assets/iconfont/iconfont.css'
import App from './App.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import piniaPersist from 'pinia-plugin-persist'
import VueLazyload from 'vue-lazyload'
import { ElLoading } from 'element-plus'
import Antd from 'ant-design-vue';
// import 'ant-design-vue/dist/antd.css';

const pinia = createPinia()
//使用pinia持久化插件
pinia.use(piniaPersist)

const app = createApp(App)

//是否显示生产模式提示信息
app.config.productionTip = false;

// 全局注册element icon 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// console.log('env', import.meta.env);
// console.log(process.env);



app.use(pinia)
    .use(router)
    .use(ElLoading)
    .use(Antd)
    .use(VueLazyload, {
        preLoad: 1.3,
        attempt: 1,
    })
    .mount('#app')

export default app
